{% extends 'base.html' %}
{% block title %}作者列表 - Local Library{% endblock %}
{% block content %}
    <h1>作者列表</h1>
    {% if author_list %}
        <table>
            <tr>
                <th>姓名</th>
                <th>出生日期</th>
                <th>去世日期</th>
            </tr>
            {% for author in author_list %}
            <tr>
                <td>{{ author.last_name }}, {{ author.first_name }}</td>
                <td>{{ author.date_of_birth }}</td>
                <td>{{ author.date_of_death }}</td>
            </tr>
            {% endfor %}
        </table>
        {% if is_paginated %}
            <div class="pagination">
                {% if page_obj.has_previous %}
                    <a href="?page={{ page_obj.previous_page_number }}">上一页</a>
                {% endif %}
                <span>第 {{ page_obj.number }} 页，共 {{ page_obj.paginator.num_pages }} 页</span>
                {% if page_obj.has_next %}
                    <a href="?page={{ page_obj.next_page_number }}">下一页</a>
                {% endif %}
            </div>
        {% endif %}
    {% else %}
        <p>暂无作者信息。</p>
    {% endif %}
{% endblock %} 